#include "basic_lib.h"
#include <stdlib.h>
#include <string.h>

void* memoryApply(memSize num, memSize size)
{
    void* buff = calloc(num, size);
    return buff;
}
void* memoryApplyOne(memSize size)
{
    void* buff = malloc(size);
    if (buff) {
        memset(buff, 0, size);
    }
    return buff;
}

void* memoryIncrease(void* memory, memSize newSize)
{
    return realloc(memory, newSize);
}

void memoryDelete(void* mem)
{
    free(mem);
    mem = NULL;
}

void memoryCopy(void* dest, const void* src, memSize _size)
{
    memcpy(dest, src, _size);
}

void memoryMove(void* dest, const void* src, memSize _size)
{
    memmove(dest, src, _size);
}

void memoryClear(void* dest, memSize _size)
{
    memset(dest, 0, _size);
}